Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

317
Visualizações
Adonis 5 + Vue "E_ROUTE_NOT_FOUND"

I'm doing an Adonis v5 app with Vue 2 as frontend. My problem is, once I've build Vue frontend into public adonis folder. If I access to a speficic route writing it into the top browser searcher, I get the E_ROUTE_NOT_FOUND from Adonis.

I do think that adonis is trying to search the route into the router of the server and not into the Vue router. Althought adonis it's configured to use static files and the first frontend page works:

Vue router.js:

Vue.use(VueRouter);
const routes = [
{
 path: "/",
 redirect: { name: "acceso" },
},
{
 path: "/acceso",
 name: "acceso",
 component: SignupView,
 meta: { guestAllow: true },
}];

const router = new VueRouter({
 mode: "history",
 routes,
});

Adonis routes.ts (It shouldn't affect as the have a prefix:

Route.group(() => {
  Route.group(() => {
    Route.post("register", "AuthController.register");
    Route.post("login", "AuthController.login");
  }).prefix("auth");
  Route.group(() => {
    Route.get("logs", "LogsController.index");
  }).middleware("auth:api");
}).prefix("/api");

Adonis static.ts:

import { AssetsConfig } from '@ioc:Adonis/Core/Static'
const staticConfig: AssetsConfig = {
 enabled: true,
 dotFiles: 'ignore',
 etag: true,
 lastModified: true,
 maxAge: 0,
 immutable: false,
}

If I write localhost:3333 on the browser I redirects to /access (Correct)

But if I refresh the page, or browse manually the same route, the error shows

Any idea of what could it be? Thank you for your time.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

After looking some other projects on internet, I've seen that if you use mode: "history" on vue-router it pops the error.

So I've tried to comment this line and now I can refresh the page without E_ROUTE_NOT_FOUND error.

Frontend Vue router.js:

const router = new Router({
  //mode: "history",
  routes,
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda